package com.modern.js.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.modern.js.entity.Orders;
import com.modern.js.mapper.OrdersMapper;
import com.modern.js.pojo.OrdersAssist;
import com.modern.js.service.IOrdersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.modern.js.utils.StringUtils;
import lombok.AllArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author PIGS
 * @since 2020-03-28
 */
@Service
@Transactional
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public IPage<OrdersAssist> selectAllOrders(Page<OrdersAssist> page,String customerName,String busubessName) {
        return ordersMapper.selectAllOrders(page,customerName,busubessName);
    }

    @Override
    public IPage<OrdersAssist> selectAllOrdersEmpId(Page<OrdersAssist> page, Integer empId) {
        return ordersMapper.selectAllOrdersEmpId(page,empId);
    }


    @Override
    public int updateOrder(Orders orders) {

        int result = ordersMapper.updateOrder(orders);
        return result;
    }

    @Override
    public OrdersAssist selectCount(String name) {
        OrdersAssist ordersAssist = ordersMapper.selectCount(name);
        return ordersAssist;
    }

}
